<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core" 
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:t="https://code.google.com/p/rad-framework/taglib" 
	xmlns:tt="https://code.google.com/p/rad-framework/pdf"
	xmlns:c="http://java.sun.com/jstl/core" 
	xmlns:p="http://jboss.com/products/seam/pdf">

	<tt:title size="#{font}" spacingBefore="10" spacingAfter="10"
		value="#{node.text}" />

	<p:font family="times-roman">
		<ui:include
			src="/#{viewPath == null ? 'pdf' : viewPath}/#{node.viewPath}#{node.type}/DetailCells.xhtml">
			<ui:param name="entity" value="#{node.instance}" />
			<ui:param name="font" value="#{font2}" />
		</ui:include>
	</p:font>

	<c:forEach items="#{node.childrenList}" var="folder">
		<p:section rendered="#{empty folder.childrenList}">
			<tt:title size="10" style="italic" spacingBefore="2"
				spacingAfter="0" value="#{messages['No']} #{folder.text}" />
		</p:section>

		<p:section rendered="#{not empty folder.childrenList}">
			<tt:title size="#{font2}" spacingBefore="10" spacingAfter="10"
				value="#{folder.text}" />

			<c:if test="#{!folder.manyToMany}">
				<c:forEach items="#{folder.childrenList}" var="kid">
					<p:section>
						<ui:include src="tree-node.xhtml">
							<ui:param name="node" value="#{kid}" />
							<ui:param name="font" value="#{font - 4}" />
							<ui:param name="font2" value="#{font2 - 4}" />
						</ui:include>
					</p:section>
				</c:forEach>
			</c:if>

			<c:if test="#{folder.manyToMany}">

				<p:table columns="#{folder.columns.size}" headerRows="1">
					<f:facet name="defaultCell">
						<p:cell horizontalAlignment="left" verticalAlignment="top" />
					</f:facet>

					<ui:insert name="headers">
						<c:forEach items="#{folder.columns}" var="c">
							<tt:header-cell label="#{c.label}" rendered="#{c.rendered}" />
						</c:forEach>
					</ui:insert>

					<ui:repeat value="#{folder.childrenList}" var="kid">
						<ui:insert name="columns">
							<c:forEach items="#{folder.columns}" var="c">
								<tt:column-cell type="#{c.type}" value="#{c.value}"
									rendered="#{c.rendered}" />
							</c:forEach>
						</ui:insert>
					</ui:repeat>
				</p:table>

			</c:if>
		</p:section>
	</c:forEach>
</ui:composition>